package com.audi.box.service;

import java.util.ArrayList;

import com.audi.box.adapter.SQLiteAsusHelperMember;
import com.audi.dto.MemberItem;

public class MemberServiceImp implements MemberService {
    
    private SQLiteAsusHelperMember mSQLHelper;
    
    public MemberServiceImp(SQLiteAsusHelperMember mSQLHelper) throws Exception {
        this.mSQLHelper = mSQLHelper;
    }
    
    public void setSQLiteHelper(SQLiteAsusHelperMember mSQLHelper) {
        this.mSQLHelper = mSQLHelper;
    }
    
    @Override
    public int addMember(MemberItem member) {
        return mSQLHelper.addMember(member);
    }
    
    @Override
    public int updateMember(MemberItem member) {
        // TODO Auto-generated method stub
        return 0;
    }
    
    @Override
    public int deleteMember(MemberItem member) {
        // TODO Auto-generated method stub
        // return mSQLHelper.deleteMember(member);
        return mSQLHelper.deleteMember(member);
    }
    
    @Override
    public boolean isExist(MemberItem member) {        
        return mSQLHelper.checkExistMember(member);
    }
    
    @Override
    public ArrayList<MemberItem> getListMember() {
        return mSQLHelper.getListMember();
    }
    
    @Override
    public MemberItem getMember(int memberId) {
        return null;
    }
    
}
